<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="./inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="用户登录" />
<%@ include file="./inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<script language="javascript">
	var errorIndex=0
	function AddFavorite() {
		var f_url = window.location.protocol + '//' + window.location.host;
		window.external.AddFavorite(f_url,'易凯软件');
	}
	function showErrorMsg(msg,index){
		if(errorIndex==0 || (errorIndex!=0 && errorIndex>index)){
			errorIndex=index;
			document.getElementById("errorMsgTd").innerHTML=msg;
		}
	}
	function goNextInput(objName){
		var obj=null;
		if(objName!=null && objName!=''){
			obj=document.getElementById(objName);
		}
		if(window.event.keyCode==13){
			if(obj!=null){
				obj.focus();
			}else{
				document.getElementById("loginButton").disabled="true";
				loginFrm.submit();
			}
		}
	}
	function doInit(){
		document.getElementById("mainTbl").style.height=document.documentElement.clientHeight+"px";
		document.getElementById("userName").focus();
	}
</script>
</head>
<body oncontextmenu="return false" onload="doInit();">
<table width="580" height="100%" align="center" cellpadding="1" cellspacing="1" id="mainTbl">
  <tr>
	<form name="loginFrm" method="post">
      <td valign="middle">
      	<table width="99%" border="1" cellpadding="1" cellspacing="0" bordercolor="#999999">
        <tr>
          <td height="395" valign="top">
          	<table width="80%" height="342" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td><img src="/images/jiemian01.jpg" width="580" height="257"></td>
            </tr>
            <tr>
              <td height="85">
              	<table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="46%" align="center">
                   
                    	<img src="${enterpriseInfo.image}" width="100">
                    	<br>
                    	 <!-- 客户满意是我们的追求 企业LOG口hao -->
                     	<span class="STYLE2">${enterpriseInfo.slogan}</span>
                    </td>
                    <td width="54%">
                    	<table width="100%"  border="0" cellspacing="0" cellpadding="0">
	                        <tr>
	                          <td colspan="2" align="center" height="30" id="errorMsgTd" class="alert_msg">
	                          	<c:if test="${alertMsg!=null && alertMsg!=''}"> ${alertMsg}
	                            <c:remove var="alertMsg" scope="session" />
	                            </c:if>
	                          </td>
	                        </tr>
	                        <spring:bind path="command.userName">
	                          <tr>
	                            <td width="132" height="30" align="right" valign="middle"><span class="STYLE2">用户名：</span></td>
	                            <td width="216" height="30" valign="middle"><input class="TextBox" type="text" style="width:160px" onKeyUp="goNextInput('password');" id='${status.expression}' name='${status.expression}' value='${status.value}' style="width:150"></td>
	                          </tr>
	                          <c:if test="${status.errorMessage!=null && status.errorMessage!=''}">
	                            <script language="javascript">
					          	showErrorMsg('${status.errorMessage}',1);
					          	loginFrm.userName.focus();
					          </script>
	                          </c:if>
	                        </spring:bind>
	                        <spring:bind path="command.password">
	                          <tr>
	                            <td height="30" align="right" valign="middle"><span class="STYLE2">密&nbsp;&nbsp;&nbsp;码：</span></td>
	                            <td height="30" valign="middle"><input class="TextBox" type="password" style="width:160px" onKeyUp="goNextInput('validateCode');" id='${status.expression}' name='${status.expression}' value='${status.value}' style="width:150"></td>
	                          </tr>
	                          <c:if test="${status.errorMessage!=null && status.errorMessage!=''}">
	                            <script language="javascript">
					          	showErrorMsg('${status.errorMessage}',2);
					          	loginFrm.password.focus();
					          </script>
	                          </c:if>
	                        </spring:bind>
	                        <spring:bind path="command.validateCode">
	                          <tr>
	                            <td height="30" align="right" valign="middle"><span class="STYLE2">验证码：</span></td>
	                            <td height="30" valign="middle">
	                            	<input class="TextBox" type="text" style="width:80px" onKeyUp="goNextInput('');" id='${status.expression}' name='${status.expression}' value=''>
	                                <img src="RandomImageCode.ihtm" align="absmiddle">
	                            </td>
	                          </tr>
	                          <c:if test="${status.errorMessage!=null && status.errorMessage!=''}">
	                            <script language="javascript">
					          	showErrorMsg('${status.errorMessage}',3);
					          	loginFrm.validateCode.focus();
					          </script>
	                          </c:if>
	                        </spring:bind>
	                        
	                        <tr>
	                          <td colspan="2" align="center">
	                          	<div align="right">
	                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
	                              <tr>
	                                <td width="7%" height="30">&nbsp;</td>
	                                <td width="74%" height="30">
	                                	<div align="right"> <span class="STYLE2"></span>	                                  	
	                                	  <input type="button" value=" 登 录 " class="buttom-a" id="loginButton" onClick="this.disabled='true';loginFrm.submit();">
	                                  	<input type="button" name="button" class="buttom-a" value=" 取 消 "  onClick="javascript:window.close();">
	                                	</div>
	                                </td>
	                                <td width="19%" height="30">&nbsp;</td>
	                              </tr>
	                              <tr>
	                                <td>&nbsp;</td>
	                                <td valign="bottom">
	                                	<div align="right"><span class="STYLE2">
	                                	<a href="javascript:showWin(500,300,'/system/OnlineList.ihtm');">谁在线</a>&nbsp;
	                                	<a href="javascript:alert('第一次登录管理易，初始用户名为admin，密码为123，登录后请马上修改密码，以确保系统安全，谢谢！');">首次如何登录？</a>
	                                	</span></div>
	                                </td>
	                                <td valign="bottom"><div align="right"><span class="STYLE2"><A  href="javascript:AddFavorite();" >添加收藏</A></span> </div></td>
	                              </tr>
	                            </table>
	                            </div>
	                          </td>
	                        </tr>
                    	</table>
                    </td>
                  </tr>
              	</table>
              </td>
            </tr>
          	</table>
          </td>
        </tr>
      	</table>
      </td>
	</form>
  </tr>
</table>

</body>
</html>